# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaSetDedicatedCrawlRateRequest do
  @moduledoc """
  Request message for CrawlRateManagementService.SetDedicatedCrawlRate method. The user can set the crawl rate for a crawl_rate_scope they own. They can set up an overall crawl rate, or set up a user-triggered crawl rate and a auto-refresh crawl rate separately. If an overall crawl rate is set, Vertex AI will automatically splits crawl_rate into user-triggered and auto-refresh.

  ## Attributes

  *   `crawlRate` (*type:* `integer()`, *default:* `nil`) - Optional. The crawl QPS set by the user. It is not guaranteed that Vertex crawl bot will crawl at this QPS. If the crawl rate is too high, the real QPS may be lower than the value set by the user to avoid overloading the user's website.
  *   `crawlRateScope` (*type:* `String.t`, *default:* `nil`) - Required. The scope of the crawl rate that the user wants to config. Currently, only domain and host name are supported. A domain name example: `example.com`. A host name example: `www.example.com`. Please do not include `/` in the domain or host name.
  *   `crawlType` (*type:* `String.t`, *default:* `nil`) - Optional. Whether it's the crawl rate of user-triggered or auto-refresh.
  *   `mode` (*type:* `String.t`, *default:* `nil`) - Optional. Whether the rate is explicitly set by users, or set by vertex AI.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :crawlRate => integer() | nil,
          :crawlRateScope => String.t() | nil,
          :crawlType => String.t() | nil,
          :mode => String.t() | nil
        }

  field(:crawlRate)
  field(:crawlRateScope)
  field(:crawlType)
  field(:mode)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaSetDedicatedCrawlRateRequest do
  def decode(value, options) do
    GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaSetDedicatedCrawlRateRequest.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaSetDedicatedCrawlRateRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
